<script src="<?php print $url?>js/jquery.ui.datepicker.js"></script>
<div id="main-content">
  <div class="container-fluid">
    <div class="row-fluid">
			<div class="span12">
				<div class="widget-block">
					<div class="widget-head">
						<h5><?php print $title?></h5>
					</div>
					<div class="widget-content">
            <div class="widget-searchbox">
              <?php print $this->form_eksternal->form_open()?>
              <ul>
                <li class="row-counts">
                  <div class="input-prepend"> <span class="add-on">Prodi-Program Kuliah</span>
                    <?php print $this->form_eksternal->form_dropdown("cari_prokul", $prokul_drop, array($prokul_pilih));?>
                  </div>
                </li>
                <li class="row-counts">
                  <div class="input-prepend"> <span class="add-on">Tanggal</span>
                    <?php print $this->form_eksternal->form_date("cari_tanggal", $tanggal_pilih, "cari_tanggal");?>
                  </div>
                </li>
              </ul>
              <ul>
                <li class="row-counts">
                  <button type="submit" name="cari" value="cari" class="btn btn-small">Search</button>
                </li>
              </ul>
              </form>
              <br />
            </div>
            <div class="widget-box">
              <table id="inti-quotation" class="table table-striped">
                <thead>
                  <tr>
                    <th><?php print lang("no")?></th>
                    <th><?php print lang("zikula_nim")?></th>
                    <th><?php print lang("name")?></th>
                    <th>Prodi-Program Kuliah</th>
                    <th>Angkatan</th>
                    <th>Pembayaran</th>
                  </tr>
                </thead>
                <tbody id="ajax-body-quotation">
                  <?php
                  $no = 1;
                  foreach($data AS $dt){
                    $this->global_models->get_connect("zikula");
                    $mahasiswa = $this->global_models->get_query("
                      SELECT A.nama, C.name AS prodi, B.nama_program AS prokul, D.nama_kelompok
                      FROM academicportal_mahasiswa AS A
                      LEFT JOIN academicportal_program_kuliah AS B ON A.program_kuliah = B.id_program_kuliah
                      LEFT JOIN academicportal_course_categories AS C ON B.category = C.id
                      LEFT JOIN academicportal_kelompok_mahasiswa AS D ON A.kelompok_mahasiswa = D.id_kelompok_mahasiswa
                      WHERE A.nim = '{$dt->nim}'
                      ");
                    $this->global_models->get_connect("default");
                  ?>
                  <tr>
                    <td><?php print $no;?></td>
                    <td><?php print $dt->nim;?></td>
                    <td><?php print $mahasiswa[0]->nama;?></td>
                    <td><?php print $mahasiswa[0]->prodi." - ".$mahasiswa[0]->prokul;?></td>
                    <td><?php print $mahasiswa[0]->nama_kelompok;?></td>
                    <td style="text-align: right"><?php print number_format($dt->saldo, 0, ",", ".");?></td>
                  </tr>
                  <?php
                    $jumlah += $dt->saldo;
                    $no++;
                  }
                  ?>
                </tbody>
                <tfoot style="background-color: #dbdbdb">
                  <tr>
                    <td colspan="5"><b>TOTAL</b></td>
                    <td style="text-align: right"><b><?php print number_format($jumlah, 0, ",", ".");?></b></td>
                  </tr>
                </tfoot>
              </table>
              <input type="text" value="create_date" id="field_simpan" style="display: none" />
              <input type="text" value="desc" id="sort_simpan" style="display: none" />
            </div>
          </div>
				</div>
			</div>
		</div>
  </div>
</div>